﻿namespace Resharper.Abstractions.Actions
{
  using System;
  using JetBrains.Annotations;
  using JetBrains.ReSharper.Feature.Services.Bulbs;
  using JetBrains.Util;

  /// <summary>Defines the <see cref="CanExecuteContext"/> class.</summary>
  public class CanExecuteContext : ProviderContext
  {
    #region Constructors and Destructors

    /// <summary>Initializes a new instance of the <see cref="CanExecuteContext"/> class.</summary>
    /// <param name="provider"></param>
    /// <param name="cache">The cache.</param>
    internal CanExecuteContext([NotNull] IContextActionDataProvider provider, [NotNull] IUserDataHolder cache) : base(provider)
    {
      if (provider == null)
      {
        throw new ArgumentNullException("provider");
      }

      if (cache == null)
      {
        throw new ArgumentNullException("cache");
      }

      this.InternalCache = cache;
    }

    #endregion

    #region Properties

    /// <summary>The cache field.</summary>
    internal IUserDataHolder InternalCache { get; private set; }

    #endregion
  }
}